﻿using M_Process.API.Appliction.Command.ProcessRouteCommand;
using M_Process.Domain;
using M_Process.Repository.ProcessInterface;
using MediatR;

namespace M_Process.API.Appliction.CommandHandlers.ProcessRouteHandler
{
    /// <summary>
    /// 反填工艺数据
    /// </summary>
    public class ProcessRouteByidCommandHandler : IRequestHandler<ProcessRouteByidCommand, ProcessRoute>
    {
        private readonly IProcessRouteRepository _processRouteRepository;
        public ProcessRouteByidCommandHandler(IProcessRouteRepository processRouteRepository)
        {
            _processRouteRepository = processRouteRepository;
        }
        public async Task<ProcessRoute> Handle(ProcessRouteByidCommand request, CancellationToken cancellationToken)
        {
            return await _processRouteRepository.GetModelsAsync(request.ProcessRouteId);
        }
    }
}
